var express = require('express');
var app = express();
var bodyParser = require('body-parser')

// app.configure(function(){
// 	app.use(express.methodOverride());
	app.use(bodyParser.json());
	app.use(bodyParser.urlencoded());
	app.use(bodyParser.text());
	app.use(bodyParser.raw());
	app.use(express.static(__dirname + '/public'));
	// app.use(express.static('./public'));
	app.engine('jade', require('jade').__express);
	// app.use(app.router);
	// app.set('view engine', 'jade');
	// app.set('views', __dirname + '/public');
	// app.set('view options', {layout: false});
	// app.set('basepath',__dirname + '/public');
// });

// app.configure('development', function(){
// 	app.use(express.static(__dirname + '/public'));
// 	app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
// });

// app.configure('production', function(){
// 	var oneYear = 31557600000;
// 	app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
// 	app.use(express.errorHandler());
// });

console.log("Web server has started.\nPlease log on http://127.0.0.1:3001/index.html");
app.listen(3001);
